home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.1 / card_9386.txt < prev    next >
Text File  |  1989-02-26  |  2KB  |  88 lines

  1. -- card: 9386 from stack: in.1
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 3837
  5. -- name: NewFileName
  6. ----- HyperTalk script -----
  7. on closecard
  8.   hide message window
  9. end closecard
  10.  
  11.  
  12. -- part 1 (button)
  13. -- low flags: 00
  14. -- high flags: A004
  15. -- rect: left=224 top=243 right=293 bottom=283
  16. -- title width / last selected line: 0
  17. -- icon id / first selected line: 27056 / 27056
  18. -- text alignment: 1
  19. -- font id: 0
  20. -- text size: 12
  21. -- style flags: 0
  22. -- line height: 16
  23. -- part name: Try it
  24. ----- HyperTalk script -----
  25. on mouseUp
  26.   if the optionkey is down then exit mouseup
  27.   put NewFileName("Your File Name","Isn't this great?!")
  28. end mouseUp
  29.  
  30.  
  31.  
  32. -- part 2 (button)
  33. -- low flags: 00
  34. -- high flags: A003
  35. -- rect: left=82 top=302 right=324 bottom=182
  36. -- title width / last selected line: 0
  37. -- icon id / first selected line: 0 / 0
  38. -- text alignment: 1
  39. -- font id: 0
  40. -- text size: 12
  41. -- style flags: 0
  42. -- line height: 16
  43. -- part name: Install
  44. ----- HyperTalk script -----
  45. on mouseUp
  46.   if the optionkey is down then pass mouseup
  47.   put installres(XFCN,NewFileName) into it
  48.   if it is empty then play oops
  49.   else answer it
  50. end mouseUp
  51.  
  52.  
  53.  
  54. -- part contents for background part 5
  55. ----- text -----
  56. NewFileName
  57.  
  58. -- part contents for background part 10
  59. ----- text -----
  60. 2
  61.  
  62. -- part contents for background part 6
  63. ----- text -----
  64.  
  65. This will allow you to use a Standard File Package 'Save' dialog box in your hypertalk scripts
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. Thanks to:
  75. Andrew Gilmartin
  76. Brown University
  77.  
  78. -- part contents for background part 7
  79. ----- text -----
  80. Syntax:
  81.  
  82. put NewFileName( <prompt>, 
  83. <initial filename> ) into SaveFileName
  84.  
  85. <prompt>, should be a simple descriptive statement about the request, such as,  "Save document as?," or  "Save test result to:."
  86.  
  87. <initial filename>.  The first time NewFileName is called this should be  empty (‚Äú‚Äù) as the user is saving an untitled document.  Thereafter, it should contain the name of the document as previously given by the user. 
  88.